package com.test;

public class Student {
    private int id;
    private String name;
    private String sex;
    private int age;

    public Student() {
    }

    public Student(int id, String name, String sex, int age) {
        this.id = id;
        this.name = name;
        this.sex = sex;
        this.age = age;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        if (sex == "男" || sex == "女") {
            this.sex = sex;
        } else {
            System.out.println("请您输入男或女");
        }

    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        if (age >= 10 && age <= 30) {
            this.age = age;
        } else {
            System.out.println("请您输入10-30岁之间的年龄");
        }

    }
}
